/**
 * Created by Administrator on 2016/11/28.
 */
$(".form-date").datetimepicker(
    {
        language: "zh-CN",
        weekStart: 1,
        todayBtn: 1,
        autoclose: 1,
        todayHighlight: 1,
        startView: 2,
        minView: 2,
        forceParse: 0,
        format: "yyyy-mm-dd"
    });
/**
 * Created by Administrator on 2016/11/15.
 */
$(function () {
    initDom();
    initEvent();
})

function initDom() {

    $("#kinds-content").hide();
    $("#qhTable_setclass").bootstrapTable({
        height: "900px",
        url: "workType.json",
        onExpandRow: orderGoodsFun
    });

    $("#qhTable_setname").bootstrapTable({
        height: "900px",
        url: "workType1.json",
        onExpandRow: orderGoodsFun
    });
    $(".fixed-table-header table").css("display", "");
    $("#qhTable_setname").css("display", "");
    $("#qhTable_setclass").css("display", "");
    $(".fixed-table-body table").css('margin-top', '0');
    $(".fixed-table-toolbar .fixed-table-container").css({"padding-bottom": "0"});

}
function orderGoodsFun(index, row, detail) {
    console.log("展开行：" + index + "   整行的值是：");
    console.log(row);
    $.getJSON("goods/data.json?", function (response) {
        var htmlStr = template('goodsTplScript', response);
        detail.html(htmlStr);
    });
}
function initEvent() {
    $(".manage ul li").on("click", function () {
        $(".manage ul li").removeClass("active");
        $(this).addClass("active");
    });

    $(".tname").on("click",function(){
        $(".setclass").css("display","none");
        $(".setname").css("display","block");
    })
    $(".tclass").on("click",function(){
        $(".setname").css("display","none");
        $(".setclass").css("display","block");
    })

}


function totalFormatter(value, row, index) {
    return "<a href='#' onclick='myClick()'>删除</a>";
}

function myClick() {
}

function myQueryParams(params) {
    params["pageNum"] = (params.offset / params.limit) + 1;
    params.pageSize = params.limit;
    params.derection = "asc";
    params.sort = "id";

    params.orderCode = $("#orderCode").val() + "";
    return params;
}

function responseHandler(res) {
    var needData = {
        rows: res.data.list,
        total: res.data.total
    };
    return needData;
}





